Skip to content

Conversation

@vincentkoppen
Copy link
Member

@vincentkoppen vincentkoppen commented Nov 12, 2025

Fixes issue: #112

Changes proposed in this PR include:

Currently we have a hardcoded list of arrays to convert to input_data.
This PR relies on ComponentType from PGM as a complete set off possible values. This also allows user to add a new component before we do with a working interface layer.

  • Loop over this instead of our hardcoded list
  • Need extra to check at some places if the array exists (if PGM adds a new component type, we shouldn't break)
  • Also renamed the load_flow file to easier find the interface in the code ;)

Comment on lines 76 to 77
for pgm_name in ComponentType:
if pgm_name in self._input_data and hasattr(self.grid, pgm_name):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or do we prefer to just use:

Suggested change
for pgm_name in ComponentType:
if pgm_name in self._input_data and hasattr(self.grid, pgm_name):
for pgm_name in self._input_data.keys():
if not hasattr(self.grid, pgm_name):
continue

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I prefer current version. But both are fine

Signed-off-by: Vincent Koppen <[email protected]>
@vincentkoppen vincentkoppen marked this pull request as draft November 13, 2025 15:40
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants